'Fruit Flies v0.2 (for DB2.43.1L)
'By Moonfisher
'A very simple tie feeder for F1.
'Beats EtchII and everything else I've tried it on so far. So it should beat the current F1 league I think.
'The reproduction gene is capped at 1000, if it's still too slow try 700, although that could change the results.
'No fancy eyes or conspec or anything of that sort, just a very simple strategy.
'v0.2 : Now addapts to it's oponent through natural selection.
'It also beats most oponents a lot faster, but has a slightly harder time beating Etch II.
'It's also now one gene and generaly shorter, planning to use it as a virus for an alge.

def maxpop 1000
def rand 110
def type 973

cond
*.nrg 10 >
*.numties 0 != or
start
.fixpos dec

'-- Birth
*.robage 0 =
628 rnd 314 sub .aimright store
300 .eye5width store
.dnalen .memloc store
.dnalen .tmemloc store
15 rnd .rand store

*.rand 3 < and
*.rand .type store

*.type 0 =
4 rnd .type store


'-- Reproduction
*.body 5 >
*.nrg 80 > and
*.maxvel .dn store
50 .repro store

*.totalmyspecies .maxpop <
*.nrg 200 > and
60 *.body 10 mult sub .strbody store


'-- Shrinking
not
*.body 1 > and
*.body 10 mult 10 sub 0 floor .fdbody store


'-- Tie feeding
*.numties 0 !=
*.tiepres .tienum store
*.trefxpos *.trefypos angle .setaim store

*.tmemval *.dnalen =
*.numties 1 > or and
*.numties .deltie store

*.numties 0 !=
*.robage 1 > and
*.maxvel .up store
*.velsx .dx store

dupbool
*.type 1 = and
.tieval .tieloc store
1000 .tieval store
.tieloc .shoot store
-1 .shootval store

dropbool
*.type 1 > and
.tieloc .tieloc store
-1 .tieval store
.tieval .shoot store
1000 .shootval store


'-- Hunting
*.numties 0 =
*.body 1 = and
dupbool
*.eye5 0 = 
*.memval *.dnalen = or and
350 .aimright store

dropbool
*.eye5 0 != and
*.memval *.dnalen != and
*.refbody 20 >
*.totalmyspecies 600 > or and
*.refxpos *.refypos angle .setaim store
.tie inc
*.velsx .dx store
*.maxvel .up store
.fixpos .shoot store
1 .shootval store
stop

end

'#tag:Fruit Flies v0.2 (F1) (Moonfisher) 25-09-08.txt
